﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RpcClient.Interface;
using RpcHelper.Error;
using RpcModel.ErrorManage;
using RpcSync.Collect;
using RpcSync.Service.Interface;

namespace RpcSync.Service.Error
{
    internal class ErrorService : IErrorService
    {
        private IRemoteSendService _Send;
        private IErrorCollect _Error;
        public ErrorService(IRemoteSendService send, IErrorCollect error)
        {
            this._Send = send;
            this._Error = error;
        }
        public void InitError(long errorId)
        {
            LocalErrorManage.Drop(errorId);
            this._Error.Refresh(errorId);
            this._Send.BroadcastMsg(new RefreshError
            {
                ErrorId = errorId
            });
        }
    }
}
